package com.zxy.ziems.server.device.pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.util.List;

/**
 * 批量插入设备和设备属性
 */
@Data
public class BatchAddDevicePropertyDTO {
    /**
     * 主键
     */
    @Null(message = "新增设备，ID必须为空", groups = DeviceDTO.Add.class)
    private String id;

    /**
     * 设备的编码
     */
    @NotEmpty(message = "设备编码不能为空", groups = {DeviceDTO.Add.class})
    private List<String> codes;

    /**
     * 通道ID
     */
    @NotBlank(message = "通道ID不可为空", groups = {DeviceDTO.Add.class})
    private String channelId;

    /**
     * 设备类型的Code
     */
    @NotBlank(message = "设备类型不能为空", groups = {DeviceDTO.Add.class})
    private String type;

    /**
     * 属性ID
     */
    @NotBlank(message = "属性ID不可为空", groups = {DeviceDTO.Add.class})
    private String dataTypeId;

    /**
     * 单位ID
     */
    @NotBlank(message = "单位ID不可为空", groups = {DeviceDTO.Add.class})
    private String unitId;

    public interface Add { }

}
